package com.library.librarybackend.domain.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author 平
 * @description 书籍格式
 * @since 2025-09-21 19:34
 */
@Getter
public enum BookFormatEnum {

    PDF("PDF"),
    EPUB("EPUB"),
    TXT("TXT");

    private final String value;

    BookFormatEnum(String value) {
        this.value = value;
    }

    public static Boolean isExist(String value) {
        return Arrays.stream(BookFormatEnum.values()).anyMatch(bookFormatEnum -> bookFormatEnum.value.equals(value));
    }

}
